/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 74646
 * Date: 2022-03-26
 * Time: 16:00
 */
class OuterClassA{
    public int data1 = 1;
    public int data2 = 2;
    public static int data3 = 3;
    //实例内部类：可以把他当做是外部类的一个不同实例成员
    class InnerClass{
        public int data4 = 4;
        private int data5 = 5;
        public static final int data6 = 6;

        public InnerClass(){
            System.out.println("不带参数的实例内部类的构造方法！");
        }
        public void test(){
            System.out.println("实例内部类的成员方法");
        }
    }

    public static void main(String[] args) {
        OuterClassA outerClass = new OuterClassA();
        OuterClassA.InnerClass innerClass = outerClass.new InnerClass();
        // OuterClass：外部类名
        // InnerClass ：内部类名
        // innerClass ：变量
        // outerClass： 外部类对象的引用
        innerClass.test();
    }
}

public class TestDemo {


}
